<style>
.jylabel-switch {padding:0.3rem 0.5rem;}
.jylabel-switch.active{
	border-radius:1.5rem;
	background-color:#00c568;
	color:#fff;
}
.fui-icon-group .fui-icon-col-sm.border {
   border: 1px solid #999;
}
</style>
<div class='fui-page-group' ng-if="pagedata.op == 'main'">
<div class='fui-page  fui-page-current'>
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">配送员中心</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content'>
		<div class="fui-list-group merchgroup">
			<div class="fui-list jump">
                <a class="fui-list-media">
                    <img class="round" src="{{tomedia(pagedata.worker.headimg) || '../core/resource/images/nopic.jpg'}}" />
                </a>
                <div class="fui-list-inner">
                    <div class="title" style="height:1.5rem"><i class="icon icon-wo1" style="color:#00c568"></i> {{pagedata.worker.title || '匿名用户'}}
						<div class="jylabel jylabel-switch-label">
							<span ng-class="{'jylabel-switch':1,'active':pagedata.worker.online==1}" ng-click="pagedata.worker.online=1;post({'id':pagedata.worker.id,'online':1},'jy_peimilk/index/setonline/');">上线</span>
							<span ng-class="{'jylabel-switch':1,'active':pagedata.worker.online==0}" ng-click="pagedata.worker.online=0;post({'id':pagedata.worker.id,'online':0},'jy_peimilk/index/setonline/');">离线</span>
						</div>
					</div>
					<div class="title" style="font-size:0.65rem">
						<span>总提成:￥ <span class="red">{{pagedata.get_money || '0.00'}}</span></span><span style="margin-left:0.2rem">待结算:￥ <span class="red">{{pagedata.lastget_money || '0.00'}}</span>
					</div>
					<div class="title" style="font-size:0.65rem">
						<span>可结算:￥ <span class="red">{{pagedata.yesget_money || '0.00'}}</span><a style="margin-left:0.2rem;color:#f60" href="javascript:;" ng-click="access_json('jy_peimilk/tixian/')">结算</a></span>
					</div>
					<div class="subtitle" style="font-size:0.65rem">只能结算{{pagedata.pluginset.cash_day || 1}}天前的提成！</div>
                </div>
                <a class="jump" href="javascript:;" ng-click="access_json('jy_peimilk/index/set/')">
					<i class="icon jinyunicon icon-set" style="width: 2rem; text-align: center;"></i>
				</a>
            </div>
		</div>
		<div class="fui-cell-group fui-cell-click" style="margin-top:0;background:none">
					<a class="fui-cell external changepwd" href="javascript:;" ng-click="pagedata.baoshow=true">
						<div class="fui-cell-text" style="text-align: center;">给客户报单</div>
					</a>
		</div>
		<div style="padding:0 0.5rem">
			<div class="fui-cellone" style="padding:0.2rem 0" href="javascript:;" ng-click="access_json('jy_peimilk/sendlog/')">
				<div class="fui-cellone-text bold">统计</div>
				<div class="fui-cellone-remark" style="font-size: 0.65rem;">查看配送单</div>
			</div>
			<div class="fui-icon-group noborder col-4">
				<div class="fui-icon-col-sm c border" style="margin-top:0">
					<div>今日配送</div>
					<div class="subtitle">{{pagedata.data.statusday || 0}}单</div>
				</div>
				<div class="fui-icon-col-sm c border" style="margin-top:0">
					<div>待配送</div>
					<div class="subtitle">{{pagedata.data.status0 || 0}}单</div>
				</div>
				<div class="fui-icon-col-sm c border" style="margin-top:0">
					<div>配送中</div>
					<div class="subtitle">{{pagedata.data.status1 || 0}}单</div>
				</div>
				<div class="fui-icon-col-sm c border" style="margin-top:0">
					<div>已完成</div>
					<div class="subtitle">{{pagedata.data.status2 || 0}}单</div>
				</div>
				<div class="fui-icon-col-sm c border" style="margin-top:0">
					<div>异常单</div>
					<div class="subtitle">{{pagedata.data.status3 || 0}}单</div>
				</div>
				<div class="fui-icon-col-sm c border" style="margin-top:0">
					<div>明日配送</div>
					<div class="subtitle">{{pagedata.data.statusmday || 0}}单</div>
				</div>
				<div class="fui-icon-col-sm c border" style="margin-top:0">
					<div>今日业绩</div>
					<div class="subtitle">{{pagedata.worker.today_money || '0.00'}}元</div>
				</div>
				<div class="fui-icon-col-sm c border" style="margin-top:0">
					<div>总业绩</div>
					<div class="subtitle">{{pagedata.worker.all_money || '0.00'}}元</div>
				</div>
			</div>
		</div>
		<div style="padding:0 0.5rem">
		<div class="weui_cells weui_cells_access">
            <a class="weui_cell" href="javascript:;" ng-click="access_json('jy_peimilk/orderuser/')">
				<div class="weui_cell_hd bold">我的客户</div>
                <div class="weui_cell_bd weui_cell_primary">
                    <span></span>
                </div>
                <div class="weui_cell_ft">属于我配送的客户</div>
            </a>
			<a class="weui_cell" href="javascript:;" ng-click="access_json('jy_peimilk/mybaodan/')">
				<div class="weui_cell_hd bold">我的客户报单</div>
                <div class="weui_cell_bd weui_cell_primary">
                    <span></span>
                </div>
                <div class="weui_cell_ft">查看报单详情</div>
            </a>
			<a class="weui_cell" href="javascript:;" ng-click="access_json('jy_peimilk/order_log/')">
                <div class="weui_cell_hd bold">我的结算</div>
                <div class="weui_cell_bd weui_cell_primary">
                    <span></span>
                </div>
                <div class="weui_cell_ft">结算提现</div>
            </a>
			<a class="weui_cell" href="javascript:;" ng-click="access_json('jy_peimilk/cash_log/')">
                <div class="weui_cell_hd bold">提现日志</div>
                <div class="weui_cell_bd weui_cell_primary">
                    <span></span>
                </div>
                <div class="weui_cell_ft">查看提现</div>
            </a>
        </div>
		<div class="fui-tab fui-tab-danger" id="tab" style="top:0.5rem">
				<a ng-class="{'external active':pagedata.showtype != '1'}" href="javascript:" ng-click="pagedata.showtype='0'">今日待配送总览表</a>
				<a ng-class="{'external active':pagedata.showtype == '1'}" href="javascript:" ng-click="pagedata.showtype='1'">明日待配送总览表</a>        

			</div>
		<div ng-if="pagedata.showtype != '1'" class="fui-cell-group fui-cell-click mod-group">
							<a class="fui-cell external" href="javascript:;" ng-click="access_json('/sendlog/')">
								<div class="fui-cell-text bold">待配送表</div>
								<div class="fui-cell-remark" style="font-size: 0.65rem;">查看全部配送单</div>
							</a>
							<div class="fui-icon-group col-3">
								<div class="fui-icon-col-sm external">
									<div class="text bold">商品名称</div>
								</div>
								<div class="fui-icon-col-sm external">
									<div class="text bold">今日待配总数</div>
								</div>
								<div class="fui-icon-col-sm external">
									<div class="text bold">今日待配单数</div>
								</div>
							</div>
							<div class="fui-icon-group col-3">
								<div class="fui-icon-col-sm">
									<div class="info bold red" style="font-size:0.6rem">统计</div>
								</div>
								<div class="fui-icon-col-sm">
									<div class="text bold red">{{pagedata.goodsnum2}}</div>
								</div>
								<div class="fui-icon-col-sm">
									<div class="text bold red">{{pagedata.daylognum2}}单</div>
								</div>
							</div>
							<div ng-repeat="item in pagedata.list2" class="fui-icon-group col-3">
								<div class="fui-icon-col-sm">
									<div class="info" style="font-size:0.6rem">{{item.title}}
									<span ng-if="item.selespename">[{{item.selespename}}]</span>
									<span ng-if="item.leititle">[<red>{{item.leititle}}</red>]</span>
									</div>
								</div>
								<div class="fui-icon-col-sm">
									<div class="text bold">{{item.num}}{{item.unit}}</div>
								</div>
								<div class="fui-icon-col-sm">
									<div class="text bold">{{item.lognum}}单</div>
								</div>
							</div>
							<div class='content-empty' ng-show="!pagedata.list || pagedata.list.length<=0" style="margin:1rem;">
								<i class='fa fa-comment-o'></i><br/>明日没有待备货商品!
							</div>
		</div>
		<div ng-if="pagedata.showtype == '1'" class="fui-cell-group fui-cell-click mod-group">
							<a class="fui-cell external" href="javascript:;" ng-click="access_json('/sendlog/')">
								<div class="fui-cell-text bold">待配送表</div>
								<div class="fui-cell-remark" style="font-size: 0.65rem;">查看全部配送单</div>
							</a>
							<div class="fui-icon-group col-3">
								<div class="fui-icon-col-sm external">
									<div class="text bold">商品名称</div>
								</div>
								<div class="fui-icon-col-sm external">
									<div class="text bold">明日待配总数</div>
								</div>
								<div class="fui-icon-col-sm external">
									<div class="text bold">明日待配单数</div>
								</div>
							</div>
							<div class="fui-icon-group col-3">
								<div class="fui-icon-col-sm">
									<div class="info bold red" style="font-size:0.6rem">统计</div>
								</div>
								<div class="fui-icon-col-sm">
									<div class="text bold red">{{pagedata.goodsnum}}</div>
								</div>
								<div class="fui-icon-col-sm">
									<div class="text bold red">{{pagedata.daylognum}}单</div>
								</div>
							</div>
							<div ng-repeat="item in pagedata.list" class="fui-icon-group col-3">
								<div class="fui-icon-col-sm">
									<div class="info" style="font-size:0.6rem">{{item.title}}
									<span ng-if="item.selespename">[{{item.selespename}}]</span>
									<span ng-if="item.leititle">[<red>{{item.leititle}}</red>]</span>
									</div>
								</div>
								<div class="fui-icon-col-sm">
									<div class="text bold">{{item.num}}{{item.unit}}</div>
								</div>
								<div class="fui-icon-col-sm">
									<div class="text bold">{{item.lognum}}单</div>
								</div>
							</div>
							<div class='content-empty' ng-show="!pagedata.list || pagedata.list.length<=0" style="margin:1rem;">
								<i class='fa fa-comment-o'></i><br/>明日没有待备货商品!
							</div>
		</div>
		<!--<div class="weui_cells weui_cells_access">
            <a class="weui_cell" href="javascript:;" >
                <div class="weui_cell_hd"><i class="icon jinyunicon icon-qrcode" style="font-size:0.9rem"></i></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <span>我的二维码</span>
                </div>
                <div class="weui_cell_ft"></div>
            </a>
        </div>-->
	</div>
	</div>
</div>
</div>
<div ng-if="pagedata.op == 'ruzhu'">
<div class="fui-header">
		<div class="fui-header-left" onclick="window.history.go(-1);">
            <a class="back"></a>
        </div>
		<div class="title">申请入驻</div>
		<div class="fui-header-right"></div>
</div>
<div style="padding:0 0.5rem">
<div class="fui-list-group merchgroup" ng-click="" style="margin-top:58px">
				<div class="fui-list jump">
					<a class="fui-list-media" ng-if="pagedata.worker.headimg">
						<img class="round" src="{{tomedia(pagedata.worker.headimg) || '../core/resource/images/nopic.jpg'}}" />
					</a>
					<a class="fui-list-media weui_uploader_input_wrp">
						<input class="weui_uploader_input" ng-click="up_file(pagedata.worker,'headimg','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
					</a>
				</div>
</div>
<div class="weui_cells weui_cells_form">
			  <div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">姓名</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.worker.name" placeholder="请输入您的真实姓名">
                </div>
            </div>
            <div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">手机</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.worker.mobile" placeholder="请输入您的手机号码">
                </div>
            </div> 
			<div class="weui_cell">
                <div class="weui_cell_hd"><label for="" class="weui_label">上门地址</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" ng-model="pagedata.worker.address" type="text" value="" placeholder="">
                </div>
                <div class="weui_cell_ft">
                    <i class="icon jinyunicon icon-ditu"></i>
                </div>
			</div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">证件</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.worker.zhengjian" placeholder="请输入您的身份证号码">
                </div>
            </div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">年纪</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.worker.age" placeholder="请输入您的年纪">
                </div>
            </div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">从事年限</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.worker.years" placeholder="请输入您的从事该行业服务年限">
                </div>
            </div>
			<div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">介绍自己</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.worker.remark" placeholder="请输入您的介绍">
                </div>
            </div>
			
</div>
<div class="weui_btn_area">
		 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="post(pagedata.worker,'set')">提交</a>
</div>
</div>
</div>
<div ng-if="pagedata.op == 'check'">
	<div class="fui-content">
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true" >
			<div class="carousel-inner" role="listbox" style="height:6rem">
				<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.banner">
					<a href="#">
						<img src="{{tomedia(item.picurl) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
					</a>
				</div>
			</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
			</style>
			<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
				<div class="fui-swipe-bullet" ng-repeat="item in pagedata.banner" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
			</div>
		</div>
		<div class="content-empty">
			  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您的入驻申请，还在审核中...</p>
		</div>
	</div>
</div>
<div ng-if="pagedata.op == 'set'">
<div class="fui-header">
		<div class="fui-header-left" onclick="window.history.go(-1);">
            <a class="back"></a>
        </div>
		<div class="title">个人设置</div>
		<div class="fui-header-right"></div>
</div>
<div style="padding:0 0.5rem">
<div class="fui-list-group merchgroup" style="margin-top:58px">
				<div class="fui-list jump">
					<a class="fui-list-media" ng-if="pagedata.worker.headimg">
						<img class="round" src="{{tomedia(pagedata.worker.headimg) || '../core/resource/images/nopic.jpg'}}" />
					</a>
					<a class="fui-list-media weui_uploader_input_wrp">
						<input class="weui_uploader_input" ng-click="up_file(pagedata.worker,'headimg','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
					</a>
				</div>
</div>
<div class="weui_cells weui_cells_form">
			  <div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">姓名</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.worker.name" placeholder="请输入您的真实姓名">
                </div>
            </div>
            <div class="weui_cell weui_vcode">
                <div class="weui_cell_hd"><label class="weui_label">手机</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" ng-model="pagedata.worker.mobile" placeholder="请输入您的手机号码">
                </div>
            </div> 
		<div class="weui_cell">
                <div class="weui_cell_hd"><label for="" class="weui_label">地址</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" ng-model="pagedata.worker.address" type="text" value="" placeholder="">
                </div>
                <div class="weui_cell_ft">
                    <i class="icon jinyunicon icon-ditu"></i>
                </div>
        </div>
</div>
<div class="weui_btn_area">
	 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="post(pagedata.worker,'set')">提交</a>
</div>
</div>
</div>
<div ng-include="sys_html('_peifooter')"></div>
<div class="fe-floatright-bottom" style="bottom:5rem">
<a ng-if="!pagedata.isopenvoice" ng-click="pagedata.isopenvoice=true;pagedata.openvoice(true)" href="javascript:;"><i class="icon icon-nolingsheng0"></i></a>
<a ng-if="pagedata.isopenvoice" ng-click="pagedata.isopenvoice=false;pagedata.openvoice(false)" href="javascript:;"><i class="icon icon-lingsheng0"></i></a> 
</div>
<audio id="openvoice" controls preload="auto" style="display:none;">
	<source src="../core/resource/images/neworder.mp3"></source>
</audio>
<div ng-if="pagedata.baoshow" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" ng-click="pagedata.baoshow=false"></i>
			 <div class='fui-cell-group fui-cell-group-o' style="padding:0.5rem 0;max-height:20rem;overflow-y:scroll">
				<div class='fui-cell-title c'>【选择要报单的商户】</div>
				<div class="fui-cell" ng-repeat="item in pagedata.merchs" href="javascript:;" ng-click="access_json('jy_peimilk/baodan//merchid='+item.id)">
						<div class="fui-cell-label" style="width:auto">
							<img style="width:2rem;height:2rem" ng-src="{{tomedia(item.logo) || '../core/resource/images/nopic.jpg'}}"/>
						</div>
						<div class="fui-cell-info">
							<div class="subtitle" >
								<span class='realname'>{{item.merchname}}</span>
							</div>
							<div class="gray" style="font-size:0.6rem">{{item.address}}</div>
						</div>
						<div class="fui-cell-remark">
							前往报单
						</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
window.scope.location(function(res){
		console.log(res)
		scope.$apply(function(){
			scope.pagedata.worker.address = res.address;
		});
});
scope.pagedata.show_verify=function(){
	var url=scope.pagedata.item.baourl;
	scope.tool.qr(url,'show_verify_ewm',150)
}
</script>
<script>
scope.pagedata.openvoice=function(type){
	var voicetime = 0;
    var openvoice;
	if(type || scope.pagedata.isopenvoice==1){
		 openvoice = setInterval(() => {
			if(!scope.pagedata.isopenvoice){
				clearInterval(openvoice);
				return false;
			}
			scope.get('jy_peimilk/index/getnew/',function(res){
						console.log('openvoice');console.log(res);
						if(res!='none'){
							if(!voicetime[res.id]){
								voicetime[res.id]=1;
								$("#openvoice")[0].play();
							}
						}
			});
		}, 5000);
	}else{
		scope.get('jy_peimilk/index/setopenvoice/isopenvoice=0',function(res){});
	}
}
scope.pagedata.openvoice();
</script>